	<script>
	import push from 'push/unipush.js';
	export default {
		onLaunch() {
			//#ifdef APP-PLUS  
				/* 客户端的基本信息，可以获取到客户端的CID 测试的时候会用到*/
				// var info = plus.push.getClientInfo();
				// var client_id = info.clientid;
			
				// /* 使用:H5+的方式监听，实现推送 */  
				plus.push.addEventListener("click", function(msg) {  
					plus.runtime.setBadgeNumber(0) 
					//这里可以写跳转业务代码
					this.handlePush(msg)
				}, false);  
				// 监听离线消息事件    
				plus.push.addEventListener("receive", function(msg) {   
					//这里可以写跳转业务代码
					plus.push.createMessage(msg); // 创建本地推送
					plus.runtime.setBadgeNumber(1) 
				}, false);  

				// 锁定屏幕方向
				plus.screen.lockOrientation("portrait-primary");  
			// #endif
			console.log('App Launch');
			push.getClient(); 
			push.init();
		},
		onHide: function() {
			// #ifdef APP
			//plus.nativeUI.toast('程序在后台运行');  
			// #endif
		},
		globalData: {
			isHuaWei: false,
		},
		onShow:function(){
			var that = this;
			var brand = uni.getSystemInfoSync().brand;
			uni.setStorageSync('brand', brand);
			if (brand == 'huawei' || brand == 'Huawei' || brand == 'HUAWEI' || brand == 'HuaWei' ) {
				that.globalData.isHuaWei = true
			} 
		},
		methods: {
            // 处理点击推送消息后的事件
			handlePush(msg) {
				uni.reLaunch({
					// 1.先重定向到首页
					url: '/pages/shop/shopClass',
					success: () => {
						uni.navigateTo({
							// 2.跳转到消息推送指定单据，payload格式：../home/index
							url: msg.payload
						});
					}
				})
			},
        },
	};
</script>
<style>
	@import './app.css';
</style>

<style lang="scss">
	

	uni-page-body,html,body{  
            height: 100%;  
        }
	
	@media screen and (min-width: 750px) { 
		page{
			max-width: 375px;
			max-height: 100vh;
			margin: 0 auto;
		}
	}


@font-face {
		font-family: 'icomoon';
		src: url('@/static/iconfont/fonts/icomoon.eot');
		src: url('@/static/iconfont/fonts/icomoon.eot#iefix') format('embedded-opentype'),
			url('@/static/iconfont/fonts/icomoon.ttf') format('truetype'),
			url('@/static/iconfont/fonts/icomoon.woff') format('woff'),
			url('@/static/iconfont/fonts/icomoon.svg#icomoon') format('svg');
		font-weight: normal;
		font-style: normal;
		font-display: block;
	}


	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	/* #ifdef APP-VUE */
	@import "uview-ui/index.scss";
	/* #endif */

	.status_bar {  
	    width: 100%;  
	    background-color: #F8F8F8;  
	}
	.top_view {  
	    width: 100%;  
	    position: fixed;  
	    background-color: #F8F8F8;  
	    top: 0;  
	    z-index: 999;  
	}
	/*每个页面公共css */
	.ui-row {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		flex-direction: row;
	}
	
	.ui-column {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		flex-direction: column !important;
	}
	
	.ui-col {
		flex: 1;
	}
	
	.flex-wrap {
		flex-wrap: wrap;
	}
	
	.ui-center {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		align-items: center;
		justify-content: center;
	}
	
	.ui-row-center {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		justify-content: center;
	}
	
	.ui-row-between {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		flex-direction: row;
		justify-content: space-between;
	}
	
	.ui-row-start {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		flex-direction: row;
		justify-content: flex-start;
	}
	
	.ui-row-end {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		flex-direction: row;
		justify-content: flex-end;
	}
	
	
	.ui-col-center {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif*/
		align-items: center;
	}
	
	/*
	 * 字体缩略
	 */
	
	.ui-strong {
		font-weight: 700;
	}
	
	.ui-txt-white {
		color: #fff;
	}
	
	.ui-txt-mute {
		color: #333;
	}
	
	.ui-txt-gray {
		color: #707070;
	}
	
	.ui-txt-info {
		color: #999;
	}
	
	.ui-font-size24 {
		font-size: 48rpx;
	}
	
	.ui-font-size20 {
		font-size: 40rpx;
	}
	
	.ui-font-size18 {
		font-size: 36rpx;
	}
	
	.ui-font-size16 {
		font-size: 32rpx;
	}
	
	.ui-font-size15 {
		font-size: 30rpx;
	}
	
	.ui-font-size14 {
		font-size: 28rpx;
	}
	
	.ui-font-size13 {
		font-size: 26rpx;
	}
	
	.ui-font-size12 {
		font-size: 24rpx;
	}
	
	.add {
		width: 48rpx;
		height: 48rpx;
	}
	
	.topM {
		/* #ifndef APP-PLUS-NVUE */
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		height: 44px;
		line-height: 44px;
		padding: var(--status-bar-height) 24rpx 0;
		background-color: #121F2C;
		z-index: 99;
		/* #endif*/
	}
	
	.body {
		margin-top: 44px;
	}
	
	.container {
		background-color: #f5f5f5;
		/* #ifndef APP-PLUS-NVUE */
		min-height: 100vh;
		box-sizing: border-box;
		padding: 0 32rpx env(safe-area-inset-bottom);
		/* #endif*/
	}
	
	.custom {
		/* #ifndef APP-PLUS-NVUE */
		padding: var(--status-bar-height) 32rpx env(safe-area-inset-bottom);
		/* #endif*/
	}
	
	.makesure {
		width: 96rpx;
		height: 56rpx;
		background: #57BE6A;
		border-radius: 8rpx;
	}
	
	.back {
		padding-right: 44rpx;
		width: 16rpx;
		height: 28rpx;
	}
	
	.arrow {
		width: 28rpx;
		height: 28rpx;
	}
	
	.send {
		width: 670rpx;
		height: 88rpx;
		/* #ifndef APP-PLUS-NVUE */
		margin: 20rpx auto 0;
		/* #endif*/
		background: #57be6a;
		color: #fff;
		border-radius: 16rpx;
	}
	
	.exit {
		width: 670rpx;
		height: 88rpx;
		/* #ifndef APP-PLUS-NVUE */
		margin: 20rpx auto 0;
		/* #endif*/
		background: #2a2a2a;
		color: #F94545;
		border-radius: 16rpx;
	}
	
	.done {
		width: 670rpx;
		height: 88rpx;
		/* #ifndef APP-PLUS-NVUE */
		margin: 20rpx auto 0;
		/* #endif*/
		background: #2a2a2a;
		color: #666;
		border-radius: 16rpx;
	}
	
	.ui-nowrap {
		overflow: hidden;
		text-overflow: ellipsis;
		/* #ifndef APP-PLUS-NVUE */
		white-space: nowrap;
		/* #endif*/
	}
	
	.hint {
		padding: 0 15rpx;
		height: 38rpx;
		background: #F43530;
		border-radius: 19rpx;
		margin-right: 0;
		/* #ifndef APP-PLUS-NVUE */
		flex-shrink: 0;
		/* #endif*/
	}
	
	/*checkbox 选项框  */
	/* #ifndef APP-PLUS-NVUE */
	scroll-view ::-webkit-scrollbar {
	   //下面四个属性，选一个就可
	    display:none;
	    width: 0; 
	    height: 0;
	    background-color: transparent; 
	}
	
	uni-checkbox .uni-checkbox-input {
		width: 36rpx !important;
		height: 36rpx !important;
		border-radius: 50%;
		margin: -10rpx 0 0 0;
		background-color: #000;
		border-color: #347BE8;
	}
	
	uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		background: #347BE8;
		border-color: #347BE8;
	}
	
	uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
		width: 20rpx;
		height: 20rpx;
		line-height: 20rpx;
		text-align: center;
		font-size: 25rpx;
		color: #fff;
		background: transparent;
		transform: translate(-70%, -50%) scale(1);
		-webkit-transform: translate(-70%, -50%) scale(1);
	}
	/* #endif*/

	
</style>
